<?php
/**
 * ATTENTION: Global boot script file, any changes may cause problem.
 */

// set error handling
error_reporting(E_ALL);

define('BASE_PATH', dirname(__FILE__));

define('DEBUG_MODE', false);

// Load necessary files
include_once(BASE_PATH . '/config/config.class.php');
include_once(BASE_PATH . '/librarys/ITHICore.php');
include_once(BASE_PATH . '/includes/functions.php');
include_once(BASE_PATH . '/librarys/registry.class.php');
include_once(BASE_PATH . '/librarys/pager.class.php');
include_once(BASE_PATH . '/librarys/Setting.class.php');
include_once(BASE_PATH . '/librarys/Cache.class.php');
function __autoload($class_name) {
    require_once(BASE_PATH."/app/{$class_name}/controllers/{$class_name}Controller.php");
}

$config = new Config;
$config ->myspace_enable = false;
$config ->facebook_enable = false;
$config ->bebo_enable = false;
$config ->yahoo_enable = false;
$config ->localpath = Config::local_path;

$time = time();
if (strpos($_SERVER['HTTP_HOST'], Config::fb_domain_name) !== false) {
    include_once(BASE_PATH . '/includes/facebook.include.php');
    $config->facebook_enable =  true;
} else {
    include_once(BASE_PATH . '/includes/dev.include.php');
    $config ->myspace_enable = true;
}
Registry::set('fbuid', $fbuid);
$localurl = Config::local_url;
$localpath = Config::local_path;
$url_ts = 'XXX';
$config->url_ts = $url_ts;
Registry::set('config', $config);
$cache = new Cache;
Registry::set('cache', $cache);
$db = new MySqlBase;
Registry::set('db', $db);

#$user = new Usermodel;
#Registry::set('user', $user);
